# Copyright [2025] [OBARA (Nanjing) Electromechanical Co., Ltd]
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.



# Generated by Django 4.2.7 on 2024-06-25 12:00

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
from django.utils import timezone


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('clamps', '0002_log_user_agent'),
    ]

    operations = [
        migrations.CreateModel(
            name='UserProfile',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('password_validity_days', models.IntegerField(choices=[(5, '5天'), (10, '10天'), (0, '永久')], default=0, verbose_name='密码有效期（天）')),
                ('password_last_changed', models.DateTimeField(default=timezone.now, verbose_name='密码最后修改时间')),
                ('max_single_download_mb', models.IntegerField(default=20, verbose_name='单次最大下载大小（MB）')),
                ('max_daily_download_gb', models.IntegerField(default=20, verbose_name='每日最大下载大小（GB）')),
                ('max_daily_download_count', models.IntegerField(default=100, verbose_name='每日最大下载文件数')),
                ('daily_download_size_mb', models.IntegerField(default=0, verbose_name='当日已下载大小（MB）')),
                ('daily_download_count', models.IntegerField(default=0, verbose_name='当日已下载文件数')),
                ('last_download_date', models.DateField(blank=True, null=True, verbose_name='最后下载日期')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='profile', to=settings.AUTH_USER_MODEL, verbose_name='用户')),
            ],
            options={
                'verbose_name': '用户配置',
                'verbose_name_plural': '用户配置',
            },
        ),
    ]

